package pl.plesken.tools;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;


public class FileCode {

	public String encode(String word) throws UnsupportedEncodingException, NullPointerException {
		
		String e = URLEncoder.encode(word, "UTF-8").replace("+", "%20");
		
		return e;
	}
	
	public String decode(String word) throws UnsupportedEncodingException, NullPointerException {

		String d = URLDecoder.decode(word, "UTF-8").replace("%20", " ");		
		
		return d;
	}

	//
}
